<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>

		<style type="text/css">
			html,
			body {
				width: 100vw;
				height: 100vh;
			}
		</style>

	</head>

	<body>

		<form style="display: none;" id="myForm" method="post" action="https://core.newebpay.com/API/CreditCard">
			MID: <input id="MedID" name="MerchantID_" readonly>
			<input id="Pos_" name="Pos_" readonly>
			<input id="PostData_" name="PostData_" readonly>
			<!-- Version: <input id="Ver" name="Version" readonly> -->
			<!-- TradeInfo: <input id="info" name="TradeInfo" value="" readonly> -->
			<!-- TradeSha: <input id="sha" name="TradeSha" readonly> -->
			<input type="submit">
		</form>

		<script>
			let form = JSON.parse(decodeURIComponent(window.location.search.substr(1).split('=')[1]))
			console.log(form, 'apple')


			window.document.getElementById('MedID').value = form.MerchantID
			window.document.getElementById('Pos_').value = form.Pos_
			window.document.getElementById('PostData_').value = form.PostData_
			// window.document.getElementById('Ver').value = form.Version
			// window.document.getElementById('info').value = form.TradeInfo
			// window.document.getElementById('sha').value = form.TradeSha

			window.document.getElementById('myForm').submit()
		</script>
	</body>

</html>